package jm.demo.je;

import java.io.Serializable;
import java.util.Random;

public class SupplierKey implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 262919250741250209L;
    
    private String number;
    
    

    public SupplierKey() {
        super();
    }

    public SupplierKey(String number) {

        this.number = number;
    }

    public final String getNumber() {

        return number;
    }
    
    public void setNumber(String number) {
        this.number = number;
    }

    public String toString() {

        return "[SupplierKey: number=" + number + ']';
    }
    
    
    
    
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((number == null) ? 0 : number.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        SupplierKey other = (SupplierKey) obj;
        if (number == null) {
            if (other.number != null)
                return false;
        } else if (!number.equals(other.number))
            return false;
        return true;
    }

    public static SupplierKey createRandom(Random r) {
        SupplierKey result = new SupplierKey();

        result.setNumber("number-" + r.nextInt());

        return result;
    }
}
